<?php
$lastRegisteredEmployees = Dracosys::getSessionValue(SESSION_INTERFACE, 'LastRegisteredEmployeesReport');
$lastFiredEmployees = Dracosys::getSessionValue(SESSION_INTERFACE, 'LastFiredEmployeesReport');
?>
<h2>Relatório de Funcion&aacute;rios</h2>
<section id="EmplReg">
    <table id="EmplReg_ReportContratados" class="Report">
        <thead>
            <tr>
                <th colspan="4">Ultimos Funcionarios Cadastrados</th>
            </tr>
            <tr class="header">
                <td>Nome</td>
                <td>Data de Admissão</td>
                <td>Cargo Atual</td>
                <td>Salário</td>
            </tr>
        </thead>
        <tbody>
            <?php
            if( !empty($lastRegisteredEmployees) ):
                foreach($lastRegisteredEmployees as $line): ?>
                    <tr>
                        <td><?=$line['StNome']?></td>
                        <td><?=$line['DtAdmissao']?></td>
                        <td><?=$line['StCargo']?></td>
                        <td><?=$line['FoSalario']?></td>
                    </tr>
                <?php
                endforeach;
            endif;
            ?>
        </tbody>
    </table>
    <table id="EmplReg_ReportDemitidos" class="Report hide">
        <thead>
            <tr>
                <th colspan="4">Ultimos Funcionarios Demitidos</th>
            </tr>
            <tr class="header">
                <td>Nome</td>
                <td>Data de Demissão</td>
                <td>Cargo</td>
                <td>Salário</td>
            </tr>
        </thead>
        <tbody>
            <?php
            if( !empty($lastFiredEmployees) ):
                foreach($lastFiredEmployees as $line):
            ?>
                <tr>
                    <td><?=$line['StNome']?></td>
                    <td><?=$line['DtAdmissao']?></td>
                    <td><?=$line['StCargo']?></td>
                    <td><?=$line['FoSalario']?></td>
                </tr>
            <?php
                endforeach;
            endif;
            ?>
        </tbody>
    </table>
    <div class="pagination">
        <a href="#" rel="ReportContratados" class="selected borderRadios">Contratados</a>
        <a href="#" rel="ReportDemitidos" class="nonselected borderRadios">Demitidos</a>
    </div>
</section>